package com.ljc.cjgl.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.ljc.cjgl.entitiy.ScoringGrade;
@Repository
public interface ScoringGradeRepository extends JpaRepository<ScoringGrade, Integer>, JpaSpecificationExecutor<ScoringGrade> {
	@Query(value="select sum(t.grade) from ScoringGrade t where t.teacher.id=?1 and t.student.id=?2 and t.scoring.test.id=?3")
	Integer findSumGradeByTeacherIdAndStudentId(Integer teacherId, Integer studentId, Integer testId);

}
